<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>转让：{{$books->book_name}} - 夜读书</title>
    <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="format-detection" content="telephone=no">
    <meta name="author" content="夜读书">
    <meta name="description" content="夜读书书城，图书赠送，交换，出售。">
    <meta name="keywords" content="夜读书，书城，图书赠送，交换，出售。">
    <link rel="stylesheet" href="{{ asset('/bootstrap-3.3.5-dist/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/mobile.css') }}">    
    <script src="{{ asset('/scripts/jquery/jquery-1.11.3.min.js') }}"></script>
    <script src="{{ asset('/bootstrap-3.3.5-dist/js/bootstrap.min.js') }}"></script>
</head>
<body>
@include('mobile.nav')
<div id="newoffer">

    <div class="review">
    <h1>转让“{{$books->book_name}}”</h1>
    <div class="article">    
    <form name="form" method="post" action="{{url('saveaddbags')}}">
    <div style="display:none;">
        <input type="hidden" name="_token" value="{{ csrf_token() }}" />
        <input type="hidden" name="book_id" value="{{$books->book_id}}" />
        <input type="hidden" name="book_name" value="{{$books->book_name}}" />
        <input type="hidden" name="zuozhe" value="{{$books->zuozhe}}" />
        <input type="hidden" name="isbn" value="{{$books->isbn}}" />
    </div>
      <table align="">
        <tbody><tr>
          <td class="" height="35" align="right" valign="top">我想:</td>
          <td width="20"></td>
          <td>
            <label><input name="otype" value="J" false="" type="radio">借阅</label>
            <label><input name="otype" value="E" false="" type="radio">交换</label>
            <label><input name="otype" value="S" false="" type="radio" checked="checked">出售</label>
            <label><input name="otype" value="Z" false="" type="radio">赠送</label>
            <!-- <label><input name="otype" value="B" type="radio">以上均可</label> -->
            <br><br>
          </td>
        </tr>
        <tr>
          <td class="" height="35" align="right" valign="top">地点:</td>
          <td width="20"></td>
          <td>
            <label><input name="scope" value="L" false="" type="radio">当地(同城)</label>
            <label><input name="scope" value="R" checked="checked" type="radio">当地或异地</label>
            <br><br>
          </td>
        </tr>
        <tr>
          <td class="" height="35" align="right" valign="top">新旧程度:</td>
          <td width="20"></td>
          <td>
            <label>
                <select id="condition" name="condition">
                  <option value="-" selected="selected">--请选择--</option>
                  <option value="10">全新</option>
                  <option value="9">9成新</option>
                  <option value="8">8成新</option>
                  <option value="7">7成新</option>
                  <option value="6">6成新</option>
                  <option value="5">5成新</option>
                  <option value="0">较旧</option>
                </select>
            </label>
            <br><br>
          </td>
        </tr>
        <tr>
          <td class="" align="right" valign="top">售价: </td>
          <td></td>
          <td>
            <input name="nowprice" id="nowprice" size="5" maxlength="10" value="" type="number" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo');">元<br><br>
          </td>
        </tr>
        <tr>
          <td class="" align="right" valign="top">数量: </td>
          <td></td>
          <td>
            <input name="num" id="num" size="5" maxlength="10" value="" type="number" onkeyup="this.value=this.value.replace(/\D/g,'');" onafterpaste="this.value=this.value.replace(/\D/g,'')";><br><br>
          </td>
        </tr>
        <tr>
          <td class="" align="right" valign="top">备注<br/>(150字内): </td>
          <td></td>
          <td><textarea name="beizhu" rows="3" cols="25%" maxlength="150"></textarea></td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td>
            <span class="ms"></span>
            <br>
            <input name="ex_submit" id="ex_submit" value="确定发布" type="button">
          </td>
        </tr>
      </tbody></table>
    </form>
    </div>
  </div>
        
</div> 

@include('mobile.footer')

<script>
$(document).ready(function(){

    $("#ex_submit").click(function(){
        if($.trim($("#condition").val())=="-")
        {
            //$(".ms").html("<font color='red'>请选择新旧程度。</font>");
            alert('请选择新旧程度。');
            $("#condition").focus();
        }
        else if($.trim($("#nowprice").val())==""){
            //$(".ms").html("<font color='red'>请输入销售价格。</font>");
            alert('请输入正确的销售价格。');
            $("#nowprice").focus();
        }
        else if($.trim($("#nowprice").val()) < 0){
            //$(".ms").html("<font color='red'>销售价格不能小于0。</font>");
            alert('销售价格不能小于0。');
            $("#nowprice").focus();
        }
        else if($.trim($("#num").val())==""){
            //$(".ms").html("<font color='red'>请输入出售数量。</font>");
            alert('请输入出售数量。');
            $("#num").focus();
        }
        else if($.trim($("#num").val()) < 0){
            //$(".ms").html("<font color='red'>出售数量不能小于0。</font>");
            alert('出售数量不能小于0。');
            $("#num").focus();
        }
        else
        {
            form.submit();
        }
    });

});
</script>
</body>
</html>